package com.example.springbootest.controller;

import com.example.springbootest.annotation.Log;
import com.example.springbootest.entity.Result;
import com.example.springbootest.entity.AjaxResult;
import com.example.springbootest.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.HashMap;
import java.util.Map;

/**
 * @author shiguorang
 * @version 1.0.0
 * @ClassName Test
 * @Description TODO
 * @createTime 2022年08月09日 16:47:00
 */
@RestController
@RequestMapping("/test")
@Slf4j
public class Test {


    @PostMapping("/testResult")
    public AjaxResult testResult(@Valid @RequestBody User user){
        return Result.success(user);
    }



    @Log(title = "test", describe = "描述")
    @GetMapping("/list")
    public Map test(){
        log.info("这是一个测试");
        HashMap<String, String> map = new HashMap<>();
        map.put("code", "200");
        map.put("msg", "test");
        return map;
    }
}
